PAY_ABILITY_ANALYSIS_CONFIG = {
    'real_time_report': False,
    'group_by': '_chn.keyword',
    "dynamic_argument": True,
    'interval_type_list': ['day'],
    'day_to_calc': [0, 1],
    'target_event_id': ['recharge', 'bet_order', 'active'],
    'on_day_event_id': ['bet_order'],
    'values': [
        {
            "value_id": "recharge_user",
            "target_value": "_user_id",
            "value_name": "充值账号",
            "filter": [
                {'terms': {'_user_id': '${recharge_users}'}}
            ],
            "operation": "cardinality",
            "value_type": "long",
        },
        {
            "value_id": "stay_2_user",
            "target_value": "_user_id",
            "value_name": "次日回流账号",
            "filter": [
                {'term': {'_event_id': 'active'}},
                {'terms': {'_user_id': '${recharge_users}'}}
            ],
            "time_range": {
                "_event_time": [1, 1]
            },
            "operation": "cardinality",
            "value_type": "long"
        },
        {
            "value_id": "stay_2_recharge_user",
            "target_value": "_user_id",
            "value_name": "次日付费账号",
            "filter": [
                {'term': {'_event_id': 'recharge'}},
                {'terms': {'_user_id': '${recharge_users}'}}
            ],
            "time_range": {
                "_event_time": [1, 1]
            },
            "operation": "cardinality",
            "value_type": "long"
        },
        {
            "value_id": "bet_user",
            "target_value": "_user_id",
            "value_name": "投注账号",
            "filter": [
                {'term': {"_event_id": 'bet_order'}},
                {'terms': {'_user_id': '${recharge_bet_users}'}}
            ],
            "not_filter": [
                {'term': {"bet_order_user_type": 1}}
            ],
            "operation": "cardinality",
            "value_type": "long"
        },
        {
            "value_id": "bet_stay_2_user",
            "target_value": "_user_id",
            "value_name": "投注次日回流账号",
            "filter": [
                {'term': {"_event_id": 'active'}},
                {'terms': {'_user_id': '${recharge_bet_users}'}}
            ],
            "time_range": {
                "_event_time": [1, 1]
            },
            "operation": "cardinality",
            "value_type": "long"
        },
        {
            "value_id": "bet_stay_2_recharge_user",
            "target_value": "_user_id",
            "value_name": "投注次日付费账号",
            "filter": [
                {'term': {'_event_id': 'recharge'}},
                {'terms': {'_user_id': '${recharge_bet_users}'}}
            ],
            "time_range": {
                "_event_time": [1, 1]
            },
            "operation": "cardinality",
            "value_type": "long"
        },
        {
            "value_id": "win_user",
            "target_value": "_user_id",
            "value_name": "中奖账号",
            "filter": [
                {'term': {"_event_id": 'bet_order'}},
                {'terms': {'_user_id': '${recharge_win_users}'}}
            ],
            "not_filter": [
                {'term': {"bet_order_user_type": 1}}
            ],
            "operation": "cardinality",
            "value_type": "long"
        },
        {
            "value_id": "win_stay_2_user",
            "target_value": "_user_id",
            "value_name": "中奖次日回流账号",
            "filter": [
                {'term': {"_event_id": 'active'}},
                {'terms': {'_user_id': '${recharge_win_users}'}}
            ],
            "time_range": {
                "_event_time": [1, 1]
            },
            "operation": "cardinality",
            "value_type": "long"
        },
        {
            "value_id": "win_stay_2_recharge_user",
            "target_value": "_user_id",
            "value_name": "中奖次日付费账号",
            "filter": [
                {'term': {'_event_id': 'recharge'}},
                {'terms': {'_user_id': '${recharge_win_users}'}}
            ],
            "time_range": {
                "_event_time": [1, 1]
            },
            "operation": "cardinality",
            "value_type": "long"
        },
        {
            "value_id": "profit_user",
            "target_value": "_user_id",
            "value_name": "盈利账号",
            "filter": [
                {'term': {"_event_id": 'bet_order'}},
                {'terms': {'_user_id': '${recharge_profit_users}'}}
            ],
            "not_filter": [
                {'term': {"bet_order_user_type": 1}}
            ],
            "operation": "cardinality",
            "value_type": "long"
        },
        {
            "value_id": "profit_stay_2_user",
            "target_value": "_user_id",
            "value_name": "盈利次日回流账号",
            "filter": [
                {'term': {"_event_id": 'active'}},
                {'terms': {'_user_id': '${recharge_profit_users}'}}
            ],
            "time_range": {
                "_event_time": [1, 1]
            },
            "operation": "cardinality",
            "value_type": "long"
        },
        {
            "value_id": "profit_stay_2_recharge_user",
            "target_value": "_user_id",
            "value_name": "盈利次日付费账号",
            "filter": [
                {'term': {'_event_id': 'recharge'}},
                {'terms': {'_user_id': '${recharge_profit_users}'}}
            ],
            "time_range": {
                "_event_time": [1, 1]
            },
            "operation": "cardinality",
            "value_type": "long"
        },
        {
            "value_id": "lose_user",
            "target_value": "_user_id",
            "value_name": "亏损账号",
            "filter": [
                {'term': {"_event_id": 'bet_order'}},
                {'terms': {'_user_id': '${recharge_lose_users}'}}
            ],
            "not_filter": [
                {'term': {"bet_order_user_type": 1}}
            ],
            "operation": "cardinality",
            "value_type": "long"
        },
        {
            "value_id": "lose_stay_2_user",
            "target_value": "_user_id",
            "value_name": "亏损次日回流账号",
            "filter": [
                {'term': {"_event_id": 'active'}},
                {'terms': {'_user_id': '${recharge_lose_users}'}}
            ],
            "time_range": {
                "_event_time": [1, 1]
            },
            "operation": "cardinality",
            "value_type": "long"
        },
        {
            "value_id": "win_stay_2_recharge_user",
            "target_value": "_user_id",
            "value_name": "亏损次日付费账号",
            "filter": [
                {'term': {'_event_id': 'recharge'}},
                {'terms': {'_user_id': '${recharge_lose_users}'}}
            ],
            "time_range": {
                "_event_time": [1, 1]
            },
            "operation": "cardinality",
            "value_type": "long"
        }
    ]
}
